def call (String actionType = 'CI&&CD'){

echo "actionType: ${actionType}"
if (actionType == 'CD') {
    echo "========================SKIPPING CHECKOUT CODE ================================="
    return}

echo "=======================CHECKOUT CODE WITH BRANCH_TAG:${params.BRANCH_TAG}==================="
        checkout([$class: 'GitSCM', 
                      branches: [[name: "${params.BRANCH_TAG}"]], 
                          doGenerateSubmoduleConfigurations: false, 
                          extensions: [], 
                          gitTool: 'Default', 
                          submoduleCfg: [], 
                          userRemoteConfigs: [[url: "${env.GIT_URL}",credentialsId: 'gitlab-private-key']]
          ])
        echo "========================CHECKOUT CODE DONE================================="

        // ！！！！必须使用 env.VERSION_NUMBER . 不能使用 VERSION_NUMBER，否认不能作为全局变量被传递
        // 获得当前 最新的commit id
        env.GIT_COMMIT_ID = sh(returnStdout: true, script: "git rev-parse --short HEAD").trim()
}
